import {searchSpan} from "@/api/span";

export const optionParent = {
  calcHeight: 95,
  tip: false,
  searchMenuSpan: searchSpan(3),
  border: true,
  index: true,
  viewBtn: false,
  menuWidth: 150,
  dialogWidth: 880,
  dialogClickModal: false,
  addBtn: false,
  delBtn:false,
  editBtn:false,
  selection:true,
  menu:false,
  column: [
    {
      label: '物资编码',
      prop: 'materialId',
      search: true,
      searchslot:true,
      hide:true,
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '物资编码',
      prop: 'materialCode',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label:'起止时间',
      prop:'startEndTime',
      type:'daterange',
      searchslot:true,
      searchRange:true,
      searchSpan:10,
      search: true,
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide:true,
    },
    {
      label: '物资名称',
      prop: 'materialName',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '规格',
      prop: 'specifications',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label:'型号',
      prop:'model',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false
    },
    {
      label:"计量单位",
      prop:'unitName',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
    },
    {
      label: '入库数量',
      prop: 'inQuantity',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '领用数量',
      prop: 'outQuantity',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '在库数量',
      prop: 'quantity',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '报废数量',
      prop: 'scrappedQuantity',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    // {
    //   label:'备注',
    //   prop:'remark',
    //   addDisplay: false,
    //   editDisplay: false,
    //   viewDisplay:false,
    // },
  ],
  group:[{
    label:"库区信息",
    column: [
      {
        label: '物资编码',
        prop: 'materialCode',
        maxlength:20,
        showWordLimit:true,
        rules:[
          {
            required:true,
            message:'请输入物资编码',
            trigger:'blur',
          }
        ]
      },
      {
        label: '物资名称',
        prop: 'materialFullName',
        maxlength:20,
        showWordLimit:true,
        rules:[
          {
            required:true,
            message:'请输入物资名称',
            trigger:'blur',
          }
        ]
      },
      {
        label: '规格',
        prop: 'specification',
        maxlength:30,
        showWordLimit:true,
        rules:[
          {
            required:true,
            message:'请输入规格',
            trigger:'blur',
          }
        ]
      },
      {
        label:'型号',
        prop:'model',
        maxlength:30,
        showWordLimit:true,
        rules:[
          {
            required:true,
            message:'请输入型号',
            trigger:'blur',
          }
        ]
      },
      {
        label:'库存数量',
        prop:'quantity',
        formslot:true,
        rules:[
          {
            required:true,
            message:'请输入库存数量',
            trigger:'blur',
          }
        ]
      },
      {
        label:"计量单位",
        prop:'unit',
       formslot:true,
        rules:[
          {
            required:true,
            message:'请选择计量单位',
            trigger:'blur',
          }
        ]
      },
      {
        label: '入库数量',
        prop: 'inQuantity',
        addDisplay: false,
        editDisplay: false,
      },
      {
        label: '领用数量',
        prop: 'outQuantity',
        addDisplay: false,
        editDisplay: false,
      },
      {
        label: '保质期(天)',
        prop: 'period',
        formslot:true,
      },
      {
        label: '生产日期',
        prop: 'productionDate',
        type:'date',
      },
      // {
      //   label:'备注',
      //   prop:'remark',
      //   span:24,
      //   type:'textarea',
      //   minRows:3,
      //   maxlength: 100,
      //   showWordLimit: true,
      // },
      {
        title: '',
        component: 'el-divider',
        span: 24,
        labelWidth: '0px',
        params: {
          contentPosition: 'left'
        },
      },
    ],
  }]
};

export const optionChild = {
  calcHeight: 95,
  tip: false,
  searchShow: true,
  searchMenuSpan: searchSpan(1),
  tree: true,
  border: true,
  index: true,
  viewBtn: true,
  menuWidth: 220,
  dialogWidth: 880,
  dialogClickModal: false,
  menu:false,
  addBtn:false,
  column: [
    {
      label:'出入库单号',
      prop:'docNo'
    },
    {
      label:'业务类型',
      prop:'docType',
      type: "select",
      dicData: [
        {
          label: "物资入库",
          value: 0
        },
        {
          label: "物资出库",
          value: 1
        }
      ],
    },
    {
      label:'物资编码',
      prop:'materialCode',
    },
    {
      label:'物资名称',
      prop:'materialName',
    },
    {
      label:'规格',
      prop:'specifications',
    },
    {
      label:'型号',
      prop:'model'
    },
    {
      label:'计量单位',
      prop:'unitName',
    },
    {
      label:'出入库数量',
      prop:'quantity',
    },
    {
      label: '报废数量',
      prop: 'scrappedQuantity',
    },
    {
      label:'领用人员',
      prop:'outUserName',
    },
    {
      label:'归还人员',
      prop:'inUserName',
    },
    {
      label:'出入库人员',
      prop:'createUserName',
    },
    {
      label:'创建日期',
      prop:'createTime',
    },
  ]
};
